<?php
class Synthesis_Workbench_Block_Cache extends Mage_Core_Block_Template
{
	private $_invalidatedTypes = array();
	
	public function __construct()
	{
		$this->_invalidatedTypes = Mage::app()->getCacheInstance()->getInvalidatedTypes();
	}
	public function getCacheCollection()
	{
		$collection = new Varien_Data_Collection();
			foreach (Mage::app()->getCacheInstance()->getTypes() as $type) {
				$collection->addItem($type);
			}
		return $collection;
	}
	
    public function checkStatus($item)
    {

        if (isset($this->_invalidatedTypes[$item->getCacheType()])) {
            $cell = 'invalidated';
        } else {
            if ($item->getStatus()) {
                $cell = 'enabled';
            } else {
                $cell = 'disabled';
            }
        }
        return $cell;
    }
	
}